import { createWebHistory, createRouter } from "vue-router";

const routes = [
  {
    path: "/",
    name: "index",
    component: () => import("@/pages/index.vue"),
  },
  {
    path: "/movie",
    name: "movie",
    component: () => import("@/pages/movie/index.vue"),
  },

  {
    path: "/movie/:id",
    name: "movieDetail",
    component: () => import("@/pages/movie/detail.vue"),
  },
  {
    path: "/movie/category/:name",
    name: "movieCategory",
    component: () => import("@/pages/movie/category.vue"),
  },
  {
    path: "/tv",
    name: "tv",
    component: () => import("@/pages/tv/index.vue"),
  },
  {
    path: "/tv/:id",
    name: "tvDetail",
    component: () => import("@/pages/tv/detail.vue"),
  },
  {
    path: "/tv/category/:name",
    name: "tvCategory",
    component: () => import("@/pages/tv/category.vue"),
  },
  {
    path: "/person/:id",
    name: "person",
    component: () => import("@/pages/person/index.vue"),
  },
  {
    path: "/genre/:id/movie",
    name: "genreMovie",
    component: () => import("@/pages/genre/movie.vue"),
  },
  {
    path: "/genre/:id/tv",
    name: "genreTv",
    component: () => import("@/pages/genre/tv.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});
export default router;
